﻿#pragma once
#include <Frameworks/DrillingrigEvent.h>
#include <Frameworks/EquipmentAction.h>
#include <QJsonObject>

class DrillingrigQmlEvent : public DrillingrigEvent, public  EquipmentAction
{
	Q_OBJECT

public:
	DrillingrigQmlEvent(QObject* parent = nullptr);
	~DrillingrigQmlEvent();

	void update(QJsonObject const& msg) override;


	void send(QJsonObject const& msg) override;


	void send(QJsonObject const& msg, QStringView to) override;


	void setMediator(AbstruactEventMediator* mediator) override;


	QStringView identity() const override;

	Q_INVOKABLE QJsonObject requestParams(QString const& host, quint16 port) const;

	Q_INVOKABLE bool emitParams(QJsonObject const& params, QString const& host, quint16 port);

	Q_INVOKABLE void debug(QUrl const& msg);
signals:
	void progressValueChanged(double);
	void tooltipMessage(QString const);
private:
	AbstruactEventMediator* m_mediator = nullptr;
};
